<?php
namespace pinduoduo\Request;

use pinduoduo\AbstractInterface\Request;

class PddDdkOauthCashgiftCreateRequest extends Request
{
    /**
     * 创建多多礼金
     * @var string
     */
    private $type = 'pdd.ddk.oauth.cashgift.create';

    /**
     * 券批次领取结束时间。note：此时间为时间戳，指格林威治时间 1970 年01 月 01 日 00 时 00 分 00 秒(北京时间 1970 年 01 月 01 日 08 时 00 分 00 秒)起至现在的总秒数
     * @var
     */
    private $acquireEndTime;

    /**
     * 券批次领取开始时间。note：此时间为时间戳，指格林威治时间 1970 年01 月 01 日 00 时 00 分 00 秒(北京时间 1970 年 01 月 01 日 08 时 00 分 00 秒)起至现在的总秒数
     * @var
     */
    private $acquireStartTime;

    /**
     * 是否自动领券，默认false不自动领券
     * @var
     */
    private $autoTake;

    /**
     * 礼金券面额，单位为分
     * @var
     */
    private $couponAmount;

    /**
     * 满减门槛，单位为分。满减门槛至少需为礼金券面额的2倍，仅对固定面额礼金券生效。
     * @var
     */
    private $couponThresholdAmount;

    /**
     * 活动持续时间，validity_time_type为 1 时必填。相对时间类型为天级时，最大值为30，即领取后30天内有效；相对时间类型为小时级时，最大值为24，即领取后24小时内有效；相对时间类型为分钟级时，则最大值为60，即领取后60分钟内有效。
     * @var
     */
    private $duration;

    /**
     * 领券是否过风控，默认true为过风控。
     * @var
     */
    private $fetchRiskCheck;

    /**
     * 活动单链接可推广礼金数，默认无限制，最小值为1。
     * @var
     */
    private $linkAcquireLimit;

    /**
     * 礼金名称
     * @var
     */
    private $name;

    /**
     * 可使用推广位列表，例如：["60005_612"]。(列表中的PID方可推广该礼金)
     * @var
     */
    private $pIdList;

    /**
     * 礼金券数量
     * @var
     */
    private $quantity;

    /**
     * 收益保护开关，默认false表示关闭，仅支持固定面额且限定商品的礼金活动。开启状态下，系统将根据设置内容进行监控，当监控项满足冻结条件时，系统自动冻结礼金暂停推广，防止资金损失。（可通过多多礼金状态更新接口自行恢复推广）
     * @var
     */
    private $rateDecreaseMonitor;

    /**
     * 相对时间类型：1-天级；2-小时级；3-分钟级，有效期类型validityTimeType = 1时必填，默认为1。 例如: relative_time_type = 2, duration = 15, 表示领取后15小时内有效。
     * @var
     */
    private $relativeTimeType;

    /**
     * 单用户可领券数量上限，默认为1。
     * @var
     */
    private $userLimit;

    public function setType($type)
    {
        $this->type = $type;
    }

    public function getType()
    {
        return $this->type;
    }

    public function setAcquireEndTime($acquireEndTime)
    {
        $this->acquireEndTime = $acquireEndTime;
    }

    public function getAcquireEndTime()
    {
        return $this->acquireEndTime;
    }

    public function setAcquireStartTime($acquireStartTime)
    {
        $this->acquireStartTime = $acquireStartTime;
    }

    public function getAcquireStartTime()
    {
        return $this->acquireStartTime;
    }

    public function setAutoTake($autoTake)
    {
        $this->autoTake = $autoTake;
    }

    public function getAutoTake()
    {
        return $this->autoTake;
    }

    public function setCouponAmount($couponAmount)
    {
        $this->couponAmount = $couponAmount;
    }

    public function getCouponAmount()
    {
        return $this->couponAmount;
    }

    public function setCouponThresholdAmount($couponThresholdAmount)
    {
        $this->couponThresholdAmount = $couponThresholdAmount;
    }

    public function getCouponThresholdAmount()
    {
        return $this->couponThresholdAmount;
    }

    public function setDuration($duration)
    {
        $this->duration = $duration;
    }

    public function getDuration()
    {
        return $this->duration;
    }

    public function setFetchRiskCheck($fetchRiskCheck)
    {
        $this->fetchRiskCheck = $fetchRiskCheck;
    }

    public function getFetchRiskCheck()
    {
        return $this->fetchRiskCheck;
    }

    public function setLinkAcquireLimit($linkAcquireLimit)
    {
        $this->linkAcquireLimit = $linkAcquireLimit;
    }

    public function getLinkAcquireLimit()
    {
        return $this->linkAcquireLimit;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setPIdList($pIdList)
    {
        $this->pIdList = $pIdList;
    }

    public function getPIdList()
    {
        return $this->pIdList;
    }

    public function setQuantity($quantity)
    {
        $this->quantity = $quantity;
    }

    public function getQuantity()
    {
        return $this->quantity;
    }

    public function setUserLimit($userLimit)
    {
        $this->userLimit = $userLimit;
    }

    public function getUserLimit()
    {
        return $this->userLimit;
    }

    public function setRateDecreaseMonitor($rateDecreaseMonitor)
    {
        $this->rateDecreaseMonitor = $rateDecreaseMonitor;
    }

    public function getRateDecreaseMonitor()
    {
        return $this->rateDecreaseMonitor;
    }

    public function setRelativeTimeType($relativeTimeType)
    {
        $this->relativeTimeType = $relativeTimeType;
    }

    public function getRelativeTimeType()
    {
        return $this->relativeTimeType;
    }

    public function getParams()
    {
        $params = [
            'type'                    => $this->type,
            'acquire_end_time'        => $this->acquireEndTime,
            'acquire_start_time'      => $this->acquireStartTime,
            'auto_take'               => $this->autoTake,
            'coupon_amount'           => $this->couponAmount,
            'coupon_threshold_amount' => $this->couponThresholdAmount,
            'duration'                => $this->duration,
            'fetch_risk_check'        => $this->fetchRiskCheck,
            'link_acquire_limit'      => $this->linkAcquireLimit,
            'name'                    => $this->name,
            'p_id_list'               => $this->pIdList,
            'quantity'                => $this->quantity,
            'rate_decrease_monitor'   => $this->rateDecreaseMonitor,
            'relative_time_type'      => $this->relativeTimeType,
            'user_limit'              => $this->userLimit,
        ];
        return array_filter($params);
    }
}
